

#ifndef _ZSUMMINFO_H_
#define _ZSUMMINFO_H_

#include "zadesk.h"
#include "zeoktest.h"

#pragma pack (push, 8)

class ZSOFT_NO_VTABLE UcDbDatabaseSummaryInfo : public UcRxObject
{
public:
    UCRX_DECLARE_MEMBERS(UcDbDatabaseSummaryInfo);

    virtual Ucad::ErrorStatus getTitle(ZTCHAR*& title) const = 0;
    virtual Ucad::ErrorStatus setTitle(const ZTCHAR* title) = 0;

    virtual Ucad::ErrorStatus getSubject(ZTCHAR*& subject) const = 0;
    virtual Ucad::ErrorStatus setSubject(const ZTCHAR* subject) = 0;

    virtual Ucad::ErrorStatus getAuthor(ZTCHAR*& author) const = 0;
    virtual Ucad::ErrorStatus setAuthor(const ZTCHAR* author) = 0;

    virtual Ucad::ErrorStatus getKeywords(ZTCHAR*& keywordlist) const = 0;
    virtual Ucad::ErrorStatus setKeywords(const ZTCHAR* keywordlist) = 0;

    virtual Ucad::ErrorStatus getComments(ZTCHAR*& comments) const = 0;
    virtual Ucad::ErrorStatus setComments(const ZTCHAR* comments) = 0;

    virtual Ucad::ErrorStatus getLastSavedBy(ZTCHAR*& lastSavedBy) const = 0;
    virtual Ucad::ErrorStatus setLastSavedBy(const ZTCHAR* lastSavedBy) = 0;

    virtual Ucad::ErrorStatus getRevisionNumber(ZTCHAR*& revisionNumber) const = 0;
    virtual Ucad::ErrorStatus setRevisionNumber(const ZTCHAR* revisionNumber) = 0;

    virtual Ucad::ErrorStatus getHyperlinkBase(ZTCHAR*& HyperlinkBase) const = 0;
    virtual Ucad::ErrorStatus setHyperlinkBase(const ZTCHAR* HyperlinkBase) = 0;

    virtual int numCustomInfo() const = 0;

    virtual Ucad::ErrorStatus addCustomSummaryInfo(const ZTCHAR* key, const ZTCHAR* value ) = 0;

    virtual Ucad::ErrorStatus deleteCustomSummaryInfo(const int index) = 0;
    virtual Ucad::ErrorStatus deleteCustomSummaryInfo(const ZTCHAR* key) = 0;

    virtual Ucad::ErrorStatus getCustomSummaryInfo(const int index, ZTCHAR*& key,
                               ZTCHAR *& value ) const = 0;

    virtual Ucad::ErrorStatus setCustomSummaryInfo (const int index, const ZTCHAR* key,
                               const ZTCHAR *value ) = 0;

    virtual Ucad::ErrorStatus getCustomSummaryInfo(const ZTCHAR *customInfoKey,
                               ZTCHAR *& value ) const = 0;

    virtual Ucad::ErrorStatus setCustomSummaryInfo (const ZTCHAR *customInfoKey,
                               const ZTCHAR *value ) = 0;

    virtual UcDbDatabase* database() const = 0; 
    virtual void setDatabase(UcDbDatabase *pDb) = 0; 

    virtual ~UcDbDatabaseSummaryInfo() {};
  protected:
    UcDbDatabaseSummaryInfo();
};

Ucad::ErrorStatus ZSOFT_STDCALL ucdbGetSummaryInfo(
                                 UcDbDatabase* pDb, 
                                 UcDbDatabaseSummaryInfo*& pInfo);

Ucad::ErrorStatus ZSOFT_STDCALL ucdbPutSummaryInfo(
                                const UcDbDatabaseSummaryInfo* pInfo,
                                UcDbDatabase *pDb);

inline Ucad::ErrorStatus ucdbPutSummaryInfo(
                                const UcDbDatabaseSummaryInfo* pInfo)
{
    return ::ucdbPutSummaryInfo(pInfo, pInfo->database());
}

class ZSOFT_NO_VTABLE UcDbSummaryInfoReactor {
public:
    virtual void summaryInfoHasChanged(
                     const UcDbDatabase* pDb, 
                     const UcDbDatabaseSummaryInfo* pDbProp) {};
    virtual ~UcDbSummaryInfoReactor() {};
};

class ZSOFT_NO_VTABLE UcDbSummaryInfoManager {
public:
    virtual void  addReactor(UcDbSummaryInfoReactor* pReact) = 0;
    virtual void  removeReactor(UcDbSummaryInfoReactor* pReact) = 0;
};

UcDbSummaryInfoManager* ZSOFT_STDCALL ucdbSummaryInfoManager();

inline void initUcDbSummaryInfoManager() {};
inline void deleteUcDbSummaryInfoManager() {};

#pragma pack (pop)
#endif 


